#include "Math.h"
#include <math.h>



inline float Vec2Length( const Vector2& v )
{
	return sqrtf( v.x*v.x + v.y*v.y );
}


// Sets the vectors length to 1, creating a unit vector
// This is accomplished by dividing the vector by its length
inline float Vec2Normalize( Vector2& v )
{
	float len = Vec2Length(v);

	if( len != 0.0f )
		v /= len;
	else
		v.x = v.y = 0.0f;

	return len;
}



inline float Vec2DotProduct( const Vector2& a, const Vector2 &b )
{
	return( a.x*b.x + a.y*b.y ); 
}